home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
recent
/
fw_gfx.lha
/
FW_GfxClip
/
GfxClip.fwrexx
next >
Wrap
Text File
|
1998-06-14
|
9KB
|
273 lines
/* Optimized with RexxOpt 1.7 */
Options results
call addlib('rexxreqtools.library',5,-30)
Address='FinalW'
STATUS PORTNAME
FW=result
address=FW
SIGNAL ON BREAK_C
Call Open("sprache","env:language","R")
language=readln("sprache")
Call Close ("sprache")
If language="deutsch" then;do
t0='"Gfx Clip 4.1 - Makro Generator" "© 1994 Softwood" "& 1998 Heiko Schröder" "Weiter" "Abbrechen" ""'
t1='"Keine Grafik ausgewählt." "Die Vorlage kann nicht erstellt werden." "" "Achso" "" ""'
t2="GFX Clip - Speichern unter"
t21="Speichern"
t3='"Sie haben keinen Dateinamen eingegeben." "Die Vorlage kann nicht erstellt werden." "" "Achso" "" ""'
t4='"Dateifehler!" "" "" "Oje" "" ""'
End
Else;do
t0='"Gfx Clip 4.1 - Macro Generator" "© 1994 Softwood" "& 1998 Heiko Schröder" "Continue" "Cancel" ""'
t1='"No object selected." "The template could not be created." "" "Okay" "" ""'
t2="GFX Clip - Save As"
t21="Save"
t3='"You have not entered a valid filename." "The template could not be created." "" "Okay" "" ""'
t4='"File error!" "" "" "Oops" "" ""'
End
ShowMessage 1 1 t0
IF (Result=2) THEN EXIT
SetMeasure RULER
GetDocItemPrefs Decimal
Punkt=Result
If Punkt="Comma" then DocItemPrefs Decimal Period
Do While 1
i=0
Object.0=0
objtype.0=0
FirstObject SELECTED
IF (Result=0) THEN;DO
ShowMessage 1 1 t1
Call SEnd
END
DO WHILE (Result ~=0)
i=i+1
Object.i=Result
NextObject Object.i SELECTED
END
gruppe=false
Do a=1 to i
GetObjectType Object.a
objtype.a=Result
If objtype.a=8 then;do
SelectObject Object.a
gruppe=true
Ungroup
FirstObject SELECTED
DO WHILE (Result ~=0)
i=i+1
Object.i=Result
NextObject Object.i SELECTED
END
End
End
If gruppe=true then;do
SelectObject Object.1
Do a=2 to i
SelectObject Object.a MULTIPLE
End
End
else leave
End
If GetClip("GFX-DIR")="" Then dir="FWMacros/"
Else dir=GetClip("GFX-DIR")
p=max(index(dir,':'),lastpos('/',dir))
file=delstr(dir,1,p)
dir=substr(dir,1,p)
filename=rtfilerequest(dir,file,t2,t21,"rt_screentofront=true rt_pubscrname=FinalWriterPubScreen")
if filename="" then;DO
ShowMessage 1 1 t3
Call SEnd
END
void=SetClip("GFX-DIR",strip(filename,B,'"'))
IF EXISTS(filename) THEN;DO
IF language="deutsch" then
t5='"Das Template <'||filename||'> existiert bereits." "Möchten Sie es überschreiben?" "" "Ja" "Nein" ""'
Else
t5='"The Template <'||filename||'> already exists." "Would you like to overwrite it?" "" "Yes" "No" ""'
ShowMessage 2 1 t5
IF (Result=2) THEN Call SEnd
END
GetPageSetup HEIGHT
pageHt=Result
IF (OPEN('GfxClipFile',filename,'Write')~=1) THEN;DO
IF language="deutsch" then
t6='"Datei <'||filename||'> kann nicht geöffnet werden." "" "" "Oje" "" ""'
Else
t6='"File <'||filename||'> could not be opened." "" "" "Ok" "" ""'
ShowMessage 1 1 t6
Call SEnd
END
CALL LineOut('GfxClipFile','/* ------------------------ */')
CALL LineOut('GfxClipFile','/* Final Writer Arexx Macro */')
CALL LineOut('GfxClipFile','/* created on' date() ' */')
CALL LineOut('GfxClipFile','/* with GfxClip 4.1 */')
CALL LineOut('GfxClipFile','/* © Softwood / H. Schröder */')
CALL LineOut('GfxClipFile','/* ------------------------ */')
CALL LineOut('GfxClipFile','')
CALL LineOut('GfxClipFile','Options Results')
CALL LineOut('GfxClipFile','SetMeasure RULER')
CALL LineOut('GfxClipFile','GetDocItemPrefs Decimal')
CALL LineOut('GfxClipFile','Punkt=Result')
CALL LineOut('GfxClipFile','If Punkt="Comma" then DocItemPrefs Decimal Period')
CALL LineOut('GfxClipFile','Status PAGE')
CALL LineOut('GfxClipFile','page1=result+1')
CALL LineOut('GfxClipFile','GetSectionSetup FirstPage')
CALL LineOut('GfxClipFile','page2=result')
CALL LineOut('GfxClipFile','page=page1-page2')
CALL LineOut('GfxClipFile','numobjs = 0')
CALL LineOut('GfxClipFile','')
x=0
DO WHILE (x<i)
x=x+1
GetObjectRotation Object.x
objRotate.x=Result
IF (objRotate.x ~=0) THEN
SetObjectRotation Object.x 0
GetObjectCoords Object.x
PARSE VAR Result page.x x1.x y1.x x2.x y2.x
IF (objRotate.x ~=0) THEN
SetObjectRotation Object.x objRotate.x
END
x=0
DO WHILE (x<i)
x=x+1
SELECT
WHEN (objtype.x=2|objtype.x=3) THEN;DO
modifier=""
if (objtype.x=3) THEN
modifier='ARROW'
commandLine='fromX =' x1.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='toX =' x2.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='fromY =' y1.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='toY =' y2.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='DrawLine page fromX fromY toX toY' modifier
CALL LineOut('GfxClipFile',commandLine)
CALL LineOut('GfxClipFile','objectid.numobjs = Result')
CALL LineOut('GfxClipFile','numobjs = numobjs + 1');
GetObjectParams Object.x TEXTFLOW FLOWDIST LINEWT
PARSE VAR Result tf fd lw
commandLine='SetObjectParams 0 TEXTFLOW' tf 'FLOWDIST' fd 'LINEWT' lw
CALL LineOut('GfxClipFile',commandLine)
GetObjectParams Object.x LINECOLOR
commandLine='SetObjectParams 0 LINECOLOR' "'"||'"'||Result||'"'||"'"
CALL LineOut('GfxClipFile',commandLine)
END
WHEN (objtype.x=4|objtype.x=5) THEN;DO
modifier=""
if (objtype.x=5) THEN
modifier='BEVEL'
commandLine='newX =' x1.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='newY =' y1.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='DrawBox page newX newY' x2.x y2.x modifier
CALL LineOut('GfxClipFile',commandLine)
CALL LineOut('GfxClipFile','objectid.numobjs = Result');
CALL LineOut('GfxClipFile','numobjs = numobjs + 1');
GetObjectParams Object.x TEXTFLOW FLOWDIST LINEWT FILL
PARSE VAR Result tf fd lw fl
commandLine='SetObjectParams 0 TEXTFLOW' tf 'FLOWDIST' fd 'LINEWT' lw 'FILL' fl
CALL LineOut('GfxClipFile',commandLine)
GetObjectParams Object.x LINECOLOR
commandLine='SetObjectParams 0 LINECOLOR' "'"||'"'||Result||'"'||"'"
CALL LineOut('GfxClipFile',commandLine)
GetObjectParams Object.x FILLCOLOR
commandLine='SetObjectParams 0 FILLCOLOR' "'"||'"'||Result||'"'||"'"
CALL LineOut('GfxClipFile',commandLine)
END
WHEN (objtype.x=6|objtype.x=9) THEN;DO
modifier=""
if (objtype.x=9) THEN
modifier='ARC'
commandLine='newX =' x1.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='newY =' y1.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='DrawOval page newX newY' x2.x y2.x modifier
CALL LineOut('GfxClipFile',commandLine)
CALL LineOut('GfxClipFile','objectid.numobjs = Result');
CALL LineOut('GfxClipFile','numobjs = numobjs + 1');
GetObjectParams Object.x TEXTFLOW FLOWDIST LINEWT FILL
PARSE VAR Result tf fd lw fl
commandLine='SetObjectParams 0 TEXTFLOW' tf 'FLOWDIST' fd 'LINEWT' lw 'FILL' fl
CALL LineOut('GfxClipFile',commandLine)
GetObjectParams Object.x LINECOLOR
commandLine='SetObjectParams 0 LINECOLOR' "'"||'"'||Result||'"'||"'"
CALL LineOut('GfxClipFile',commandLine)
GetObjectParams Object.x FILLCOLOR
commandLine='SetObjectParams 0 FILLCOLOR' "'"||'"'||Result||'"'||"'"
CALL LineOut('GfxClipFile',commandLine)
END
WHEN (objtype.x=7) THEN;DO
commandLine='newX =' x1.x ''
CALL LineOut('GfxClipFile',commandline)
commandLine='newY =' y1.x ''
CALL LineOut('GfxClipFile',commandline)
GetTextBlockText Object.x
text=Result
commandLine='DrawTextBlock page newX newY "'||text||'"'
CALL LineOut('GfxClipFile',commandLine)
CALL LineOut('GfxClipFile','objectid.numobjs = Result');
CALL LineOut('GfxClipFile','numobjs = numobjs + 1');
GetObjectParams Object.x TEXTFLOW FLOWDIST
PARSE VAR Result tf fd
commandLine='SetObjectParams 0 TEXTFLOW' tf 'FLOWDIST' fd
CALL LineOut('GfxClipFile',commandLine)
GetObjectTypeSpecs Object.x SIZE LEADING WIDTH OBLIQUE
PARSE VAR Result sz ld wd ob
commandLine='SetObjectTypeSpecs 0 SIZE' sz 'LEADING' ld 'WIDTH' wd 'OBLIQUE' ob
CALL LineOut('GfxClipFile',commandLine)
GetObjectTypeSpecs Object.x COLOR
commandLine='SetObjectTypeSpecs 0 COLOR' "'"||'"'||Result||'"'||"'"
CALL LineOut('GfxClipFile',commandLine)
GetObjectTypeSpecs Object.x FONT
commandLine='SetObjectTypeSpecs 0 FONT "'||Result||'"'
CALL LineOut('GfxClipFile',commandLine)
END
OTHERWISE ITERATE
END
IF (objRotate.x ~=0) THEN;DO
commandLine='SetObjectRotation 0' objRotate.x
CALL LineOut('GfxClipFile',commandLine)
END
GetObjectTitle object.x
commandLine='SetObjectTitle 0 "'||Result||'"'
CALL LineOut('GfxClipFile',commandLine)
CALL LineOut('GfxClipFile','')
END
CALL LineOut('GfxClipFile','i = 0')
CALL LineOut('GfxClipFile','DO WHILE (i < numobjs)')
CALL LineOut('GfxClipFile','SelectObject objectid.i MULTIPLE')
CALL LineOut('GfxClipFile','i = i + 1')
CALL LineOut('GfxClipFile','END')
CALL LineOut('GfxClipFile','')
CALL LineOut('GfxClipFile','Redraw')
CALL LineOUt('GfxClipFile','GraphicTool')
CALL LineOut('GfxClipFile','')
CALL LineOut('GfxClipFile','If Punkt="Comma" then DocItemPrefs DECIMAL Comma')
CALL CLOSE('GfxClipFile');
x=0
DO WHILE (x<i)
X=X+1
SelectObject Object.x MULTIPLE
END
Call SEnd
LineOut:PROCEDURE
PARSE ARG filehandle,str
len=WRITELN(filehandle,str)
IF (len ~=LENGTH(str)+1) THEN;DO
ShowMessage 1 1 t4
CALL CLOSE(filehandle);
EXIT
END
RETURN
SEnd:
If Punkt="Comma" then DocItemPrefs DECIMAL Comma
Exit
RETURN